package com.cbhb.sys;

import java.util.Stack;

public class GetDecimalValue {

    public int getDecimalValue(ListNode head) {
        int sum = 0;
        while (head != null) {
            sum = sum << 1 + head.val;
            head = head.next;
        }
        return sum;
    }
}

class ListNode {
    int val;
    ListNode next;
    ListNode(int x) { val = x; }
}
